
/*
 * @Descripttion: 供应商
 * @version:
 * @Author: zp
 * @Date: 2019-08-16 09:17:57
 * @LastEditors: zp
 * @LastEditTime: 2020-08-24 07:50:54
 */

export default {
  data () {
    return {
      columnsData: [
        { field: 'id', title: 'ID', fixed: 'left', width: 100 },
        { field: 'supplierNo', title: '编号', width: 100 },
        { field: 'supplierName', title: '名称', width: 100 },
        { field: 'address', title: '地址', width: 100 },
        { field: 'mobileNo', title: '手机号', width: 80 },
        { field: 'bankName', title: '开户行', width: 80 },
        { field: 'bankAccount', title: '银行卡号', width: 200 },
        { field: 'telNo', title: '座机号', width: 80 },
        { field: 'contact', title: '联系人', width: 80 },

        { field: 'level', title: '级别', width: 100 },
        { field: 'email', title: 'Email', width: 80, show: false },
        
        { field: 'payableAmount', title: '应付款', width: 80 },

        { field: 'supplierCategoryName', title: '供应商分类名称', width: 160 },
        { field: 'salespersonName', title: '业务员', width: 80 },
        { field: 'taxNumber', title: '税号', width: 80 },
        { field: 'province', title: '省份', width: 80 },
        { field: 'city', title: '城市', width: 80 },
        { field: 'companyWebsite', title: '公司网站', width: 80 },
        { field: 'supplierStatus', title: '供应商状态', width: 160 },
        { field: 'priceLevel', title: '售价级别', width: 80 },

        { field: 'firstApprovalProduct', title: '首营产品', width: 80 },
        { field: 'fax', title: '传真', width: 80 },
        { field: 'enterpriseNature', title: '企业性质', width: 80 },

        { field: 'supplierLevel', title: '供应商级别', width: 160 },
        { field: 'department', title: '所属部门', width: 80 },

        { field: 'remarks', title: '备注', width: 80 },
      ],
      // table遮罩层
      tableLoading:false,
      // table数据
      tableData: [],
    }
  },
  methods: {
    btnGetStock (params) {
      this.currentRow = params.row
      this.dialogVisible = true
    },
    btnStockLog (params) {
      const { row } = params
      const { skuId, name } = row
      this.$router.push({
        name: 'StockLogList',
        query: { id: skuId, name }
      })
    },
    footerMethod ({ columns, data }) {
      let array = []
      if (data.length > 0) {
        array = [
          columns.map((column, columnIndex) => {
            if (columnIndex === 0) {
              return '合计'
            }
            const tableTotal = this.tableTotal || {}
            return tableTotal[column.property]
          })
        ]
        return array
      }
      return []
    },
    onCellDblClick ({ row }) {
      // this.$emit('on-to-detail', row)
      console.log("onCellDblClick",row);
    },
  }
}

